package com.xcx.portal.controller;


import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.xcx.common.services.RulerService;

/**
 * 尺子controller
 *
 * @author 杨俊
 */
@RestController
@RequestMapping(value = "/xcx/ruler")
public class RulerController {

    @Reference
    private RulerService rulerService;

    /**
     * 用户登录
     *
     * @param reqStr
     * @return
     */
    @RequestMapping(value = "/userLogin", produces = {"application/json;chart=UTF-8"})
    @ResponseBody
    public String userLogin(@RequestBody String reqStr) {
        return rulerService.userLogin(reqStr);
    }

    /**
     * 保存用户信息
     *
     * @param reqStr
     * @return
     */
    @RequestMapping(value = "/saveUserInfo", produces = {"application/json;chart=UTF-8"})
    @ResponseBody
    public String saveUserInfo(@RequestBody String reqStr) {
        return rulerService.saveUserInfo(reqStr);
    }
}
